\section{Lokarria}
    
    When launching \textit{MRDS} with \textit{Lokarria} module enabled, a local server is started on port 50 000. Information about the robot can be retrieved by accessing that server using \textit{HTTP} requests on different URL. All communication with that server are made using \textit{JSON} format.

    \subsection{Retrieving information from server}
        
        To get information from the server, we execute a \textit{GET} request to specific URL. Each following subsection will describe how to retrieve information.
        
        \subsubsection{Position of the robot}
            
            To get position of the robot, a \textit{GET} request is send to the following URL :
            \begin{verbatim}
                http://localhost:50000/lokarria/localization
            \end{verbatim}
            
            Server responds in a \textit{JSON} string like below :
            \begin{verbatim}
                {
                "Pose":
                {
                    "Orientation":
                    {
                        "W":-0.70752808315921567,
                        "X":0,
                        "Y":0,
                        "Z":0.70668522804785294
                    },
                    "Position":
                    {
                        "X":0.062024351309485075,
                        "Y":-4.8787359764368405,
                        "Z":0
                    }
                },
                "Status":0,
                "Timestamp":75949220
                }
            \end{verbatim}
            A pose element contains the orientation, which is a quaternion which describes three dimensional rotation, and the position, which corresponds to the robot coordinates in its environment.          
                
        \subsubsection{Differential drive of the robot}
        
             To get differential drive information, a \textit{GET} request is send to the following URL :
            \begin{verbatim}
                http://localhost:50000/lokarria/differentialdrive
            \end{verbatim}
            
            Server responds in a \textit{JSON} string like below :
            \begin{verbatim}
                {
                   "Command":
                   {
                        "TargetAngularSpeed":0,
                        "TargetLinearSpeed":0
                   },
                   "Feedback":
                   {
                        "CurrentAngularSpeed":2.3046566639095545E-05,
                        "CurrentLinearSpeed":4.1944749682443216E-06,
                        "Enabled":true
                   },
                   "Properties":
                   {
                       "MaxAngularAcceleration":6,
                       "MaxAngularDeceleration":-6,
                       "MaxAngularSpeed":1.5,
                       "MaxLinearAcceleration":2,
                       "MaxLinearDeceleration":-2,
                       "MaxLinearSpeed":1,
                       "MinAngularSpeed":-1.5,
                       "MinLinearSpeed":-1,
                       "Width":0.36399999260902405
                   },
                   "Timestamp":14703680
               }
            \end{verbatim}     
        
        \subsubsection{Lasers properties}
            
             To get laser properties, a \textit{GET} request is send to the following URL :
            \begin{verbatim}
                http://localhost:50000/lokarria/laser/properties
            \end{verbatim}
            
            Server responds in a \textit{JSON} string like below :
            \begin{verbatim}
                {
                "AngleIncrement": 0.017388889226511769,
                "EndAngle":2.3561944901923448,
                "Pose":
                {
                    "Orientation":
                    {
                        "W":1,
                        "X":0,
                        "Y":0,
                        "Z":0
                    },
                    "Position":
                    {
                        "X":0.15,
                        "Y":0,
                        "Z":0.2
                    }
                },
                "StartAngle":-2.3561944901923448
                }
            \end{verbatim}     
        
        \subsubsection{Lasers echoes}
        
            To get laser echoes, a \textit{GET} request is send to the following URL :
            \begin{verbatim}
                http://localhost:50000/lokarria/laser/properties
            \end{verbatim}
            
            Server responds in a \textit{JSON} string like below :
            \begin{verbatim}
                {
                    "Echoes":[
0.884,0.9,0.916,0.932,0.95,0.969,0.989,1.01,1.032,1.056,1.064,1.06,1.047,
1.035,1.024,1.013,1.002,0.992,0.983,0.974,0.965,0.957,0.95,0.942,0.936,
0.929,0.923,0.917,0.912,0.907,0.902,0.898,0.893,0.89,0.886,0.883,0.88,
0.877,0.875,0.873,0.871,0.87,0.869,0.868,0.867,0.866,0.866,0.866,0.867,
0.867,0.868,0.869,0.871,0.872,0.874,0.876,0.879,0.882,0.885,0.888,0.892,
0.896,0.9,0.905,0.91,0.915,0.921,0.927,0.933,0.94,0.947,0.954,0.962,0.97,
0.979,0.988,0.998,1.008,1.019,1.03,1.042,1.055,1.068,1.082,1.096,1.111,
1.127,1.144,1.162,1.18,1.2,1.221,1.242,1.265,1.289,1.315,1.342,1.37,1.401,
1.433,1.466,1.503,1.541,1.582,1.625,1.672,1.722,1.775,1.833,1.895,1.962,
2.034,2.113,2.198,2.28,2.279,2.264,2.25,2.236,2.224,2.212,2.201,2.191,2.182,
2.174,2.166,2.159,2.152,2.146,2.141,2.137,2.133,2.13,2.128,2.126,2.16,2.159,
2.159,4.016,4.018,4.022,4.028,4.034,4.042,4.051,4.061,4.073,4.086,4.1,4.116,
4.133,4.151,4.171,4.192,4.215,4.24,4.266,4.278,2.358,2.342,2.36,2.346,2.36,
2.38,2.402,2.424,2.448,2.473,2.5,2.527,2.556,2.587,2.619,2.653,2.688,2.726,
2.765,2.806,2.85,2.895,2.943,2.994,3.047,3.103,3.162,3.225,3.291,3.361,3.435,
3.513,3.597,3.685,3.779,3.879,3.986,4.101,4.156,4.115,4.076,4.039,4.004,3.97,
3.938,3.908,3.88,3.853,3.828,3.804,3.781,3.76,3.741,3.722,3.705,3.69,3.675,
3.662,3.65,3.639,3.629,3.621,3.613,3.607,3.602,3.598,3.595,3.593,3.592,3.592,
3.594,3.596,3.6,3.605,3.611,3.618,3.626,3.635,3.645,3.408,3.122,2.882,2.677,
2.499,2.345,2.209,2.089,1.981,1.885,1.798,1.719,1.647,1.582,1.522,1.467,1.416,
1.369,1.325,1.285,1.247,1.211,1.178,1.148,1.119,1.091,1.066,1.042,1.019,0.997,
0.977,0.958,0.94,0.922
],
                "Overflow":[
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
                "Reflector":[
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
               "Timestamp":147070
}
            \end{verbatim}    
            
        
    \subsection{Sending order to the robot}
    
        The robot can receive two orders which consist of setting its angular or linear speed. To send such an order, a \textit{POST} request is send to the following URL :
        \begin{verbatim}
             http://localhost:50000/lokarria/differentialdrive
        \end{verbatim}
        
        The \textit{HTTP} header \verb?Content-type? must specify that the request contains \textit{JSON}, so its value must be \verb?application/json?. Sent data must be like as follows :
        \begin{verbatim}
            {"TargetAngularSpeed": 0, "TargetLinearSpeed": 0}
        \end{verbatim}